<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/styles.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/tools.js"></script>
	<script type="text/javascript" src="js/script.js"></script>
	<script type="text/javascript" src="js/jquery.corner.js"></script>
	<script type="text/javascript">
		function checkValue(){
			if($("#casetitle").val().length<=0){
				alert("标题不能为空");
			}else if($("#username").val().length<=0){
				alert("用户名不能为空");
			}else if($("#casecontent").val().length<=20){
				alert("内容不能小于20个字!");
			}else{
				sendForm.submit();
			}
		}
	</script>
	
  </head>
  
  <body>
  	<div align="center" style="height: 180px;">
		<div id="top" style="width:950px;">
			<img src="images/logo.jpg" width="950" height="150" border="0" />
			<p style="font-size: 14px;float: left;">您当前的位置:&nbsp;&nbsp;<a href="findProductAction">首页</a>&nbsp;&nbsp;>>&nbsp;&nbsp;<a href="findCaseAction">案例展示</a>&nbsp;&nbsp;>>&nbsp;&nbsp;发表</p>
		</div>
	</div>
  	<div align="center">
  		<h1>发表博客</h1>
  		<s:form action="sendBlogAction" method="post" name="sendForm">
  		<s:textfield label="标题" name="caseTitle" id="casetitle" maxlength="10"/>
  		<s:if test="#session.ui!=null">
  			<s:textfield label="您的姓名" name="userName" id="username" maxlength="10" value="静姐"/>
  		</s:if>
  		<s:else>
  			<s:textfield label="您的姓名" name="userName" id="username" maxlength="10"/>
  		</s:else>
  		<s:textarea label="内容" name="caseContent" cols="60" rows="20" id="casecontent"/>
  	</s:form>
  	<input type="button" onclick="checkValue()" class="btn" value="发表"/>
  	</div>
  	<hr width="100%" style="color:#ccc;float: left;position: relative;top:20px;" />
	<br />
	<div align="center" style="width: 100%;float: left;position: relative;top: 20px;">
		<a href="#" style="text-decoration:none;color:#666;font-size: 14px;">联系我们</a>&nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="#" style="text-decoration:none;color:#666;font-size: 14px;">加入我们</a>&nbsp;&nbsp;|&nbsp;&nbsp;
		<s:if test="#session.ui!=null">
			<a href="exitAction"
				style="text-decoration:none;color:#666;font-size: 14px;">【退出】</a>
		</s:if>
		<s:else>
			<a href="javascript:showBox('登录','login()')"
				style="text-decoration:none;color:#666;font-size: 14px;">管理员入口</a>
		</s:else>
		<br /> <br /> <br />
	</div>
  </body>
</html>
